package com.sos.config
{
	
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	public class ConfigurationManagerEvent extends Event
	{
		
		// -------------------------------------------------------------------------------
		// CONSTANTS
		// -------------------------------------------------------------------------------
		
		// Events
		public static const     EVENT_LOAD_STARTED:String			= "configurationManagerLoadStarted";
		public static const     EVENT_LOAD_COMPLETED:String			= "configurationManagerLoadCompleted";
		public static const		EVENT_LOAD_FAILED:String			= "configurationManagerLoadFailed";
		public static const     EVENT_LOAD_CANCELLED:String			= "configurationManagerLoadCancelled";
		
		
		// -------------------------------------------------------------------------------
		// FIELDS
		// -------------------------------------------------------------------------------
		
		private var _manager:ConfigurationManager;
		private var _configuration:Configuration;
		private var _message:String;
		
		// -------------------------------------------------------------------------------
		// CONSTRUCTOR
		// -------------------------------------------------------------------------------
		
		/**
		 * Create a generic SoS_Application event
		 * @param t Event type name
		 * @param c SoS_ApplicationEvent reference
		 */		
		public function ConfigurationManagerEvent(type:String, configurationManager:ConfigurationManager, message:String = "", configuration:Configuration = null)
		{
			super(type);
			// Init
			_manager = configurationManager;
			_configuration = configuration;
			_message = message;
		}
		
		// -------------------------------------------------------------------------------
		// PROPERTIES
		// -------------------------------------------------------------------------------
		
		public function get manager():ConfigurationManager
		{
			return _manager;
		}

		public function get configuration():Configuration
		{
			return _configuration;
		}
		
		public function get hasConfiguration():Boolean
		{
			return _configuration != null;
		}		

		public function get message():String
		{
			return _message;
		}

		
	}
}